set nocount on if object_id('tempdb..#list', 'U') is not null drop table #list select cast(@@servername as varchar(30)) as [server] create table #list([Most of the Objects With Permissions Granted to Public] varchar(80)) insert #list exec sp_msforeachdb 'use ? select distinct cast(db_name() + ''..'' + object_name(id) as varchar(80)) from syspermissions where grantee = 0 and id > 100 and grantor <> 3 and object_name(id) not like ''sys%'' and object_name(id) not like ''dt_%'' and object_name(id) not like ''sp_%''' select * from #list